package api;

import java.util.ArrayList;

import dataobjects.AlbumTemplate;
import dataobjects.CardInstance;
import dataobjects.CardTemplate;
import dataobjects.Invite;
import dataobjects.User;

public interface API {

	boolean register(String username, String name, String mail, String password);

	boolean login(String username, String password);

	boolean signout(String username);

	/**
	 * 
	 * @param username
	 * @param pinCode
	 * @return List of CardInstances. If pincode is illegal returns null;
	 */
	ArrayList<CardInstance> enterPincode(String username, String pinCode);

	String getNotifications(String username);

	User getUserDetails(String username);

	ArrayList<AlbumTemplate> getActiveAlbums();

	/**
	 * Check if the user have the album Check if the user have the card Check if
	 * the album contain this card & is not already pasted
	 * 
	 * @param username
	 *            The user who wishes to paste a card
	 * @param cardInstanceID
	 *            Instance ID of the selected card
	 * @param albumInstanceID
	 *            Instance ID of the album that contain the card
	 * @return On success: list of pasted cards for the album. On failure: null.
	 */
	ArrayList<Integer> pasteCard(String username, int cardInstanceID,
			int albumID);

	/**
	 * Searchs for users with mathing wishlish & tradelist to 'username's wish
	 * list & trade list
	 * 
	 * @param username
	 *            the requesting user
	 * @return list of users
	 */
	ArrayList<User> findMatchingUsers(String username);

	// Possible we want to create a new data object and call it invite? and have
	// this method return the new invite created.
	boolean createTradeInvite(String requestingUser, String acceptingUser,
			int givesID, int getsID);

	Invite createGameInvite(String requestingUser, String acceptingUser,
			int givesID, int getsID, String type);

	// boolean acceptTradeInvite(String requestingUser,String acceptingUser, int
	// givesID, int getsID);

	ArrayList<Invite> getInvites(String username);

	/**
	 * Changes status of invite to 1 (CONFIRMED)
	 * 
	 * @return false in case of error, true otherwise
	 */
	Invite confirmInvite(String askUsername, String recievingUsername,
			int wantInstanceID, int giveInstanceID, String type);

	/**
	 * Changes status of invite to -1 (DECLINED)
	 * 
	 * @return false in case of error, true otherwise
	 */
	boolean declineInvite(String askUsername, String recievingUsername,
			int wantInstanceID, int giveInstanceID, String type);

	boolean cancelGameInvite(String askingUsername, String receivingUsername,
			int giveCardID, int wantCardID, String type);
	
	
	String makeTurnRPC(String username, String turn, String gameName);

}
